package com.wbt.bambootown.mvp.presenter;


import com.wbt.bambootown.entity.CameraPic;
import com.wbt.bambootown.entity.ControlLog;
import com.wbt.bambootown.mvp.contract.CameraPicContract;
import com.wbt.bambootown.mvp.contract.ControlLogContract;
import com.wbt.bambootown.mvp.frame.ActivityPresenter;
import com.wbt.bambootown.mvp.model.CameraPicModel;
import com.wbt.bambootown.mvp.model.ControlLogModel;
import com.wbt.bambootown.rx.FilterSubscriber;

import java.util.List;

public class ControlLogPresenter extends ActivityPresenter<ControlLogModel,ControlLogContract.View> implements ControlLogContract.Presenter{
    public static final String TAG = "ControlLogPresenter";

    @Override
    public void getControlLog2(int id, int pageIndex, int pageSize, String begin, String end) {
        addSubscription(getModel().getControlLog2(id, pageIndex, pageSize, begin, end), new FilterSubscriber<List<ControlLog>>() {
            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().showError(errorMsg);
            }

            @Override
            public void onNext(List<ControlLog> controlLogs) {
                getView().showLogSuccess(controlLogs);
            }
        });
    }
}
